import { Vertify } from '@alex_xu/react-slider-vertify';
import './HuaKuai.css'
import { useState, FC } from 'react'
import { Mask, Toast } from 'antd-mobile';
export const HK: FC<{
    callback: Function,
    setshow: Function,
    show:boolean
}> = ({
    callback,
    setshow,
    show
}) => {

        const onSuccess = () => {
            callback();
            setshow(false)
        }
        return (
            <Mask 
            visible={show}
            style={{display:'flex',justifyContent:'center',alignItems:'center'}}
            onMaskClick={() => setshow(false)}
            opacity='thin'>

                    <Vertify
                        width={320}
                        height={160}
                        onSuccess={onSuccess}    //成功触发事件
                        onFail={() => { Toast.show({ content: "验证失败" }) }} // 失败触发事件
                    />

            </Mask>

        )
    }